<template>
    <div class='relation'>
        <div class="boxin">
            <div class="boxl">
                <div class="txt txt1">
                    <p class="title">关联商品</p>
                </div>
            </div>
            <div class="boxr">
                <el-form :model="queryParams" ref="queryForm" :inline="true" class="search-con">
                    <el-form-item label="" prop="key_state_id" style="margin-left: 60px;">
                        <el-select v-model="queryParams.key_state_id" placeholder="请选择商品分类" clearable size="small">
                            <el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" prop="key_state_id">
                        <el-select v-model="queryParams.key_state_id" placeholder="请选择品牌" clearable size="small">
                            <el-option v-for="dict in statusList" :key="dict.id" :label="dict.name" :value="dict.id" />
                        </el-select>
                    </el-form-item>
                    <el-form-item label="" prop="key_name">
                        <el-input v-model="queryParams.key_name" placeholder="请输入搜索关键词" clearable size="small" />
                    </el-form-item>
                    <el-form-item>
                        <el-button type="cyan" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
                    </el-form-item>
                </el-form>
                <el-form ref="form" :model="form" :rules="rules" label-width="200px" v-loading="loading">
                    <el-col :span="20">
                        <el-form-item label="" prop="detail">
                            <el-transfer v-model="value" :titles="['全部列表', '关联列表']" :props="{key: 'value',label: 'desc'}" :data="data">
                            </el-transfer>
                        </el-form-item>
                    </el-col>
                </el-form>
                <div class="button">
                    <el-button @click="$emit('prev')">上一步，填写商品属性</el-button>
                    <el-button type="primary" @click="submit">完成，提交商品</el-button>
                </div>
            </div>
        </div>
    </div>
</template>
<script>
export default {
    name: 'relation',
    components: {

    },
    data() {
        const generateData = _ => {
            const data = [];
            for (let i = 1; i <= 15; i++) {
                data.push({
                    value: i,
                    desc: `备选项 ${i}`,
                    // disabled: i % 4 === 0
                });
            }
            return data;
        };
        return {
            loading: false,
            pageCount: 0,
            listsCount: 0,
            queryParams: {
                page: 1,
                limit: 20,
            },
            form: {

            },
            rules: {

            },
            statusList: [
                {
                    dictLabel: '确定购买',
                    dictValue: 0
                },
                {
                    dictLabel: '了解中',
                    dictValue: 1
                },
                {
                    dictLabel: '暂时放弃',
                    dictValue: 2
                }
            ],

            data: generateData(),
            value: []
        }
    },
    created() {

    },
    methods: {
        getList() {
            // this.loading = true;
            // getGoodLists(this.queryParams).then(res => {
            //     this.tableList = res.data[0].lists;
            //     this.pageCount = res.data[0].pageCount;
            //     this.listsCount = res.data[0].listsCount;
            //     this.loading = false;
            // });
        },
        handleQuery() {
            this.queryParams.page = 1;
            this.getList();
        },
        resetQuery() {
            this.resetForm("queryForm");
            this.handleQuery();
        },
        submit() {

        }
    },
}

</script>
<style scoped lang='scss'>
</style>